package top.v5it.japi.ddd.spring.boot.autoconfigure.properties;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author zhanpu
 * @date 2023/3/24
 */
@Data
@ConfigurationProperties("spring.japi.ddd")
public class JapiDddProperties {

    /**
     * 数据中心ID
     */
    private long datacenterId;

    /**
     * 终端ID
     */
    private long workerId;

    private String vObjFilepath;

    /**
     * 配置{@link Validator}验证器
     */
    private Validator validator;

    /**
     * 验证器
     */
    @Getter
    public static class Validator {

        /**
         * 应用{@link javax.validation.Validator}时，是否采用快速失败验证模式
         */
        @Setter
        private boolean failFast;
    }
}
